package vip.youngboy.freejump.persist.bus.busobj;

import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import vip.youngboy.freejump.domain.bus.BusObj;
import vip.youngboy.freejump.repository.BusObjRepository;

import java.util.List;

@Component
public class DefaultBusObjPersistence implements BusObjPersistence {

    @Autowired
    private BusObjRepository busObjRepository;

    @Override
    public BusObj getByKey(String boKey) {
        return busObjRepository.findByKey(boKey).orElse(null);
    }

    @Override
    public List<JSONObject> boTreeData(String boKey) {
        return null;
    }

    @Override
    public BusObj getFilledByKey(String boKey) {
        //TODO 根据业务对象与业务表的关联填充实体
        BusObj busObj = getByKey(boKey);


        return null;
    }

    private void fillBusObj(BusObj busObj) {
        //填充业务表对象

    }

}
